<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>生命周期函数</title>
</head>

<body>
    <div id="app">
        <h1>{{msg}}</h1>
    </div>
</body>

</html>
<script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            msg: "Vue的生命周期"
        },
        created: function () {
            console.log("el=" + this.$el);
        },
        beforeMount: function () {
            console.log("el=" + this.$el);
        },
        /* 省略其它生命周期函数 */
    })
</script>